import Vue from 'vue';
import Router from 'vue-router';



Vue.use(Router);
// vue-router路由懒加载
export default new Router({
    routes: [{
        path: '/',
        name: 'Hello',
        component: resolve => require(['../components/Hello.vue'], resolve)
    }, {
        path: '/film/:id',
        name: 'detail',
        component: resolve => require(['../components/detail.vue'], resolve)
    }, {
        path: '/login',
        name: 'login',
        component: resolve => require(['../components/login.vue'], resolve)
    }, {
        path: '/yingyuan',
        name: 'yingyuan',
        component: resolve => require(['../components/yingyuan.vue'], resolve),
        redirect: '/yingyuan/nowpalyy',
        children: [{
                path: "/yingyuan/comingsoony",
                name: 'comingsoon',
                component: resolve => require(['../components/comingsoony.vue'], resolve)
            }, {
                path: "/yingyuan/nowpalyy",
                name: 'nowpalyy',
                component: resolve => require(['../components/nowpalyy.vue'], resolve)
            }

        ]

    }, {
        path: "/cinema",
        name: 'cinema',
        component: resolve => require(['../components/cinema.vue'], resolve)
    }, {
        path: '*',
        redirect: '/hello'
    }]
})